using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Xml;
using System.Web;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Search;
using DotNetNuke.Framework;

namespace SmallAdvert
{
    public class tm_small_advertController : DotNetNuke.Entities.Modules.ISearchable, DotNetNuke.Entities.Modules.IPortable
    {
        #region "Public Methods"
        public tm_small_advertInfo Get(int advertId)
        {
            return (tm_small_advertInfo)DotNetNuke.Common.Utilities.CBO.FillObject(DataProvider.Instance().Gettm_small_advert(advertId), typeof(tm_small_advertInfo));
        }

        public ArrayList List()
        {
            return DotNetNuke.Common.Utilities.CBO.FillCollection(DataProvider.Instance().Listtm_small_advert(), typeof(tm_small_advertInfo));
        }

        public ArrayList GetBytm_users(int userId)
        {
            return DotNetNuke.Common.Utilities.CBO.FillCollection(DataProvider.Instance().Gettm_small_advertBytm_users(userId), typeof(tm_small_advertInfo));
        }

        public int Add(tm_small_advertInfo objtm_small_advert)
        {
            return (int)DataProvider.Instance().Addtm_small_advert(objtm_small_advert.subject, objtm_small_advert.contents, objtm_small_advert.openDate, objtm_small_advert.closeDate, objtm_small_advert.createDate, objtm_small_advert.createBy, objtm_small_advert.Status, objtm_small_advert.editBy);
        }

        public void Update(tm_small_advertInfo objtm_small_advert)
        {
            DataProvider.Instance().Updatetm_small_advert(objtm_small_advert.advertId, objtm_small_advert.subject, objtm_small_advert.contents, objtm_small_advert.openDate, objtm_small_advert.closeDate, objtm_small_advert.createDate, objtm_small_advert.createBy, objtm_small_advert.Status, objtm_small_advert.editBy);
        }

        public void Delete(int advertId)
        {
            DataProvider.Instance().Deletetm_small_advert(advertId);
        }
        #endregion

        #region "Optional Interfaces"
        public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo)
        {
            return null;
        }

        public string ExportModule(int ModuleID)
        {
            return "";
        }

        public void ImportModule(int ModuleID, string Content, string Version, int UserId)
        {
        }
        #endregion
    }
}


